From a8cc5c12fbdb6206e695fcf021626a5677523b00 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Fri, 14 Jan 2011 08:08:37 +0000 Subject: [PATCH] vt-d: Fix crash issue when not sharing EPT and VT-d tables. Signed-off-by: Allen Kay --- xen/drivers/passthrough/vtd/iommu.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c index b04203dcc7..dee64ff510 100644 --- a/xen/drivers/passthrough/vtd/iommu.c +++ b/xen/drivers/passthrough/vtd/iommu.c @@ -1773,9 +1773,13 @@ void iommu_set_pgd(struct domain *d) ASSERT( is_hvm_domain(d) && d->arch.hvm_domain.hap_enabled ); iommu_hap_pt_share = vtd_ept_share(); + if ( !iommu_hap_pt_share ) + goto out; + pgd_mfn = pagetable_get_mfn(p2m_get_pagetable(p2m_get_hostp2m(d))); hd->pgd_maddr = pagetable_get_paddr(pagetable_from_mfn(pgd_mfn)); +out: dprintk(XENLOG_INFO VTDPREFIX, "VT-d page table %s with EPT table\n", iommu_hap_pt_share ? "shares" : "not sharing"); -- 2.30.2